 
import React from 'react'

class EventObject extends React.Component{

    handerClick = (e) => { 
        // 阻止浏览器的默认行为
        e.preventDefault();
        
        console.log('黑马');
    }
     
    // 返回一个jsx结构
    render() {
        return (<div>
            {/* <a href="http://www.itheima.com" onClick={ this.handerClick }>黑马官网</a> */}
            {/* <a href="http://www.itheima.com" onClick={(e) => { this.handerClick(e); }}>黑马官网</a>  */}
            <a href="http://www.itheima.com" onClick={ this.handerClick }>黑马官网</a> 
        </div>)
    }
 }

export default EventObject;